<?php
    include "../admin/config/mysql.php";
	header("content-type:text/html;charset=utf-8");	
	$username=$_POST["username"];
	$message=$_POST["content"];
	$kid=$_POST["kid"];
	$id=$_POST["id"];
	$title=$_POST["title"];
	$flag=0;
	$time=time();

	 if(!empty($username)){

	 $str=$pdo->exec("insert into message (username,kid,time,message,title,flag) values('$username',$id,$time,'$message','$title',$flag)");
	 if($str){
	 	header("refresh:1;url=../article.php?id=$id&&kid=$kid");
	 	print("发布成功,等待管理员的审核通过后即可查看,请稍后.....");
	 }else{
	 	header("refresh:1;url=../article.php?id=$kid&&kid=$kid");
	 	print("发布失败,请稍后.....");
	 }
	}else{
        header("refresh:1;url=../log.php");
	 	print("登入后才能留言,正在为你跳转到登入界面,请稍后.....");
	}
 

	




?>